package com.iplant.wms.service.po.bms;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.po.BasePO;
import com.iplant.base.po.enums.DBSchemas;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;
import com.iplant.base.utils.annotation.join.DBJoin;
import com.iplant.basic.service.basicenum.bms.BMSFunctionType;

import java.io.Serializable;


/**
 * 班组管理范围
 *
 * @author YouWang·Peng
 * 2023-7-14 22:05:20
 */
@DBBasePO(TableName = "bms_classrange", CheckName = {"ClassInfoID,DeviceID"}, Schemas = DBSchemas.WMS, Active = false)
public class BMSClassRange extends BasePO implements Serializable {

    /**
     * 序列号
     */
    private static final long serialVersionUID = 1L;

    /**
     * 班组信息ID
     */
    @DBCondition
    @DBField(CheckValue = true)
    public int ClassInfoID = 0;

    /**
     * 班组ID（来源于部门）
     */
    @DBCondition
    @DBField(CheckValue = true)
    public int DepartmentID = 0;

    /**
     * 班组名称（来源于部门）
     */
    @DBCondition
    @DBJoin(name = "Name", tableName = "bms_department", tableAsName = "t1", Schemas = DBSchemas.Basic,
            MainTableField = "DepartmentID")
    public String DepartmentName = "";

    /**
     * 班组编码（来源于部门）
     */
    @DBCondition
    @DBJoin(name = "Code", tableName = "bms_department", tableAsName = "t1", Schemas = DBSchemas.Basic,
            MainTableField = "DepartmentID")
    public String DepartmentCode = "";

    /**
     * 班组职能
     */
    @DBJoin(name = "FunctionType", tableName = "bms_classinfo", tableAsName = "t2", Schemas = DBSchemas.Basic,
            MainTableField = "ClassInfoID")
    public int FunctionType = 0;

    /**
     * 班组职能（翻译）
     */
    public String FunctionTypeName = "";

    /**
     * 库位ID
     */
    @DBField(CheckValue = true)
    @DBCondition
    public int StationID = 0;
    /**
     * 设备名称
     */
    @DBJoin(name = "Name", tableName = "wms_store_station", tableAsName = "t7", Schemas = DBSchemas.WMS,
            MainTableField = "StationID")
    public String StationName = "";
    /**
     * 设备编码
     */
    @DBJoin(name = "Code", tableName = "wms_store_station", tableAsName = "t7", Schemas = DBSchemas.WMS,
            MainTableField = "StationID")
    public String StationCode = "";

    /**
     * 设备状态
     */
    @DBCondition
    @DBJoin(name = "Active", tableName = "wms_store_station", tableAsName = "t7", Schemas = DBSchemas.WMS,
            MainTableField = "StationID")
    public int StationActive = 0;


    /**
     * 货架ID
     */
    @DBCondition
    @DBJoin(name = "StoreShelfID", tableName = "wms_store_station", tableAsName = "t7", Schemas = DBSchemas.WMS,
            MainTableField = "StationID")
    public int StoreShelfID = 0;
    /**
     * 货架名称
     */
    @DBJoin(name = "Name", tableName = "wms_store_shelf", tableAsName = "r1", Schemas = DBSchemas.WMS, JoinIndex = 2
            , ConditionalJoin = "t7.StoreShelfID=r1.ID")
    public String StoreShelfName = "";
    /**
     * 货架编码
     */
    @DBJoin(name = "Code", tableName = "wms_store_shelf", tableAsName = "r1", Schemas = DBSchemas.WMS, JoinIndex = 2
            , ConditionalJoin = "t7.StoreShelfID=r1.ID")
    public String StoreShelfCode = "";


    /**
     * 库区ID
     */
    @DBCondition
    @DBJoin(name = "StoreAreaID", tableName = "wms_store_station", tableAsName = "t7", Schemas = DBSchemas.WMS,
            MainTableField = "StationID")
    public int StoreAreaID = 0;
    /**
     * 库区名称
     */
    @DBJoin(name = "Name", tableName = "wms_store_area", tableAsName = "t5", Schemas = DBSchemas.WMS, JoinIndex = 2
            , ConditionalJoin = "t7.StoreAreaID=t5.ID")
    public String StoreAreaName = "";
    /**
     * 库区编码
     */
    @DBJoin(name = "Code", tableName = "wms_store_area", tableAsName = "t5", Schemas = DBSchemas.WMS, JoinIndex = 2
            , ConditionalJoin = "t7.StoreAreaID=t5.ID")
    public String StoreAreaCode = "";


    /**
     * 区域ID
     */
    @DBCondition
    @DBJoin(name = "StoreRegionID", tableName = "wms_store_station", tableAsName = "t7", Schemas = DBSchemas.WMS,
            MainTableField = "StationID")
    public int StoreRegionID = 0;
    /**
     * 区域名称
     */
    @DBJoin(name = "Name", tableName = "wms_store_region", tableAsName = "t4", Schemas = DBSchemas.WMS, JoinIndex = 2,
            ConditionalJoin = "t7.StoreRegionID=t4.ID")
    public String StoreRegionName = "";
    /**
     * 区域编码
     */
    @DBJoin(name = "Code", tableName = "wms_store_region", tableAsName = "t4", Schemas = DBSchemas.WMS, JoinIndex = 2,
            ConditionalJoin = "t7.StoreRegionID=t4.ID")
    public String StoreRegionCode = "";


    /**
     * 仓库ID
     */
    @DBCondition
    @DBJoin(name = "StoreID", tableName = "wms_store_station", tableAsName = "t7", Schemas = DBSchemas.WMS,
            MainTableField = "StationID")
    public int StoreID = 0;

    /**
     * 仓库名称
     */
    @DBJoin(name = "Name", tableName = "wms_store", tableAsName = "f1", Schemas = DBSchemas.Basic, JoinIndex = 2,
            ConditionalJoin = "t7.StoreID=f1.ID")
    public String StoreName = "";

    /**
     * 仓库编号
     */
    @DBJoin(name = "Code", tableName = "wms_store", tableAsName = "f1", Schemas = DBSchemas.Basic, JoinIndex = 2,
            ConditionalJoin = "t7.StoreID=f1.ID")
    public String StoreCode = "";


    @JsonProperty("ClassInfoID")
    public int getClassInfoID() {
        return ClassInfoID;
    }

    public void setClassInfoID(int classInfoID) {
        ClassInfoID = classInfoID;
    }

    @JsonProperty("DepartmentID")
    public int getDepartmentID() {
        return DepartmentID;
    }

    public void setDepartmentID(int departmentID) {
        DepartmentID = departmentID;
    }

    @JsonProperty("DepartmentName")
    public String getDepartmentName() {
        return DepartmentName;
    }

    public void setDepartmentName(String departmentName) {
        DepartmentName = departmentName;
    }

    @JsonProperty("DepartmentCode")
    public String getDepartmentCode() {
        return DepartmentCode;
    }

    public void setDepartmentCode(String departmentCode) {
        DepartmentCode = departmentCode;
    }

    @JsonProperty("FunctionType")
    public int getFunctionType() {
        return FunctionType;
    }

    public void setFunctionType(int functionType) {
        FunctionType = functionType;
    }

    @JsonProperty("FunctionTypeName")
    public String getFunctionTypeName() {

        FunctionTypeName = BMSFunctionType.getEnumType(FunctionType).getLabel();
        return FunctionTypeName;
    }

    public void setFunctionTypeName(String functionTypeName) {
        FunctionTypeName = functionTypeName;
    }

    @JsonProperty("StationID")
    public int getStationID() {
        return StationID;
    }

    public void setStationID(int stationID) {
        StationID = stationID;
    }

    @JsonProperty("StationName")
    public String getStationName() {
        return StationName;
    }

    public void setStationName(String stationName) {
        StationName = stationName;
    }

    @JsonProperty("StationCode")
    public String getStationCode() {
        return StationCode;
    }

    public void setStationCode(String stationCode) {
        StationCode = stationCode;
    }

    @JsonProperty("StationActive")
    public int getStationActive() {
        return StationActive;
    }

    public void setStationActive(int stationActive) {
        StationActive = stationActive;
    }

    @JsonProperty("StoreShelfID")
    public int getStoreShelfID() {
        return StoreShelfID;
    }

    public void setStoreShelfID(int storeShelfID) {
        StoreShelfID = storeShelfID;
    }

    @JsonProperty("StoreShelfName")
    public String getStoreShelfName() {
        return StoreShelfName;
    }

    public void setStoreShelfName(String storeShelfName) {
        StoreShelfName = storeShelfName;
    }

    @JsonProperty("StoreShelfCode")
    public String getStoreShelfCode() {
        return StoreShelfCode;
    }

    public void setStoreShelfCode(String storeShelfCode) {
        StoreShelfCode = storeShelfCode;
    }

    @JsonProperty("StoreAreaID")
    public int getStoreAreaID() {
        return StoreAreaID;
    }

    public void setStoreAreaID(int storeAreaID) {
        StoreAreaID = storeAreaID;
    }

    @JsonProperty("StoreAreaName")
    public String getStoreAreaName() {
        return StoreAreaName;
    }

    public void setStoreAreaName(String storeAreaName) {
        StoreAreaName = storeAreaName;
    }

    @JsonProperty("StoreAreaCode")
    public String getStoreAreaCode() {
        return StoreAreaCode;
    }

    public void setStoreAreaCode(String storeAreaCode) {
        StoreAreaCode = storeAreaCode;
    }

    @JsonProperty("StoreRegionID")
    public int getStoreRegionID() {
        return StoreRegionID;
    }

    public void setStoreRegionID(int storeRegionID) {
        StoreRegionID = storeRegionID;
    }

    @JsonProperty("StoreRegionName")
    public String getStoreRegionName() {
        return StoreRegionName;
    }

    public void setStoreRegionName(String storeRegionName) {
        StoreRegionName = storeRegionName;
    }

    @JsonProperty("StoreRegionCode")
    public String getStoreRegionCode() {
        return StoreRegionCode;
    }

    public void setStoreRegionCode(String storeRegionCode) {
        StoreRegionCode = storeRegionCode;
    }

    @JsonProperty("StoreID")
    public int getStoreID() {
        return StoreID;
    }

    public void setStoreID(int storeID) {
        StoreID = storeID;
    }

    @JsonProperty("StoreName")
    public String getStoreName() {
        return StoreName;
    }

    public void setStoreName(String storeName) {
        StoreName = storeName;
    }

    @JsonProperty("StoreCode")
    public String getStoreCode() {
        return StoreCode;
    }

    public void setStoreCode(String storeCode) {
        StoreCode = storeCode;
    }
}
